﻿#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<string.h>
#include<stdlib.h>

void change(int a, int b)
{
	int temp = a;
	a = b;
	b = temp;
	printf("2.此时change函数内部，都是形参，则a,b的值为：%d,%d\n", a, b);//20,10
}

//main87&88：函数实参传给形参和指针函数
int main87()
{
	int a = 10;
	int b = 20;
	//4.值传递：将实参的值传递给形参；
	change(a, b);
	printf("1.输出使用change函数后a,b的值，其实也不会变，形参改变不了实参的值，即：%d,%d\n", a, b);//10,20

	system("pause");
	return EXIT_SUCCESS;
}
void pointerChange(int* a, int* b)
{
	int temp = *a;
	*a = *b;
	*b = temp;
}
int main88(void)
{
	int a = 10;
	int b = 20;
	pointerChange(&a, &b);
	printf("3.使用指针函数pointerChange来交换a,b的值，即：%d,%d\n", a, b);//20,10
	return 0;
}